import React, {Component, Fragment} from 'react';
import {Table, Input, TimePicker, message, Tabs, Radio, Button,} from 'antd';
import "./UpperPartOfTheForm.css"
import moment from 'moment';
import "./BottomPartOfTheForm.css"

const TabPane = Tabs.TabPane;
const {TextArea} = Input;//文本输入框

class UpperPartOfTheForm extends Component {
    constructor(props) {
        super(props);
        this.state = {
            Time: [],//第一列的时间变化自动控制
            Data: [],//原始填写的数据
            TabChoose: 0,
            average: [null, null, null, null, null, null, null, null, null,
                null, null, null, null, null, null, null, null, null,
                null, null, null, null, null, null, null, null, null],//平均
            ratio: [null, null, null, null, null, null, null, null, null,
                null, null, null, null, null, null, null, null, null,
                null, null, null, null, null, null, null, null, null,],//比值
            passRate: [null, null, null, null, null, null, null, null, null,
                null, null, null, null, null, null, null, null, null,
                null, null, null, null, null, null, null, null, null,],//合格率
            isNormal: [],
            // person: this.props.person
        }
    }

    /**
     * 第一列的时间变化
     */
    componentWillMount() {
        const BanCi = ['零点班', '八点班', '十六点班'];
        this.setState({
            BanCi: BanCi[this.props.timeChose],
            Data: this.props.upperData,
        });
    }

    /**更新props**/
    componentWillReceiveProps(nextProps) {
        const BanCi = ['零点班', '八点班', '十六点班'];
        this.setState({
            BanCi: BanCi[nextProps.timeChose],
            Data: nextProps.upperData,
        });
        // this.updataData_Initial(nextProps.standard);
    }


    updataData_Initial(standard) {
        let temp1 = 0;//计算均值和合格率的临时数据
        let temp2 = 0;
        let temp3 = 0;
        let str = '';//计算合格比率的临时数据
        let inputCount0 = [], inputCount8 = [], inputCount16 = [];//各班次输入的总数
        let passCount0 = [], passCount8 = [], passCount16 = [];//各班次的合格数
        let passRate0 = [], passRate8 = [], passRate16 = [];//各班次的合格率
        let ratio0 = [], ratio8 = [], ratio16 = [];//各班次的合格比率
        //计算合格率部分
        for (let i = 0; i < 9; i++) {//i是列
            inputCount0[i] = 0;//0点班输入的总数
            passCount0[i] = 0;//0点班合格数
            inputCount8[i] = 0;//8点班输入的总数
            passCount8[i] = 0;//8点班合格数
            inputCount16[i] = 0;//16点班输入的总数
            passCount16[i] = 0;//16点班合格数
            for (let j = 0; j <= 7; j++) {//j是行
                if (!isNaN(this.state.Data[j]['shuju'][i]) && (this.state.Data[j]['shuju'][i] != null)) {
                    inputCount0[i]++;
                    if (this.state.Data[j]['shuju'][i] <= standard[i]) {
                        passCount0[i]++;
                    }
                }
                if (inputCount0[i] === 0) {
                    str = null;
                    temp1 = null;
                }
                else {
                    str = passCount0[i] + '\/' + inputCount0[i];
                    if (isNaN(temp1 = passCount0[i] / inputCount0[i])) {
                        temp1 = null;
                    }
                    else {
                        temp1 = Number(temp1 * 100).toFixed(1) + '%';
                    }
                }
                ratio0[i] = str;
                passRate0[i] = temp1;
            }
            for (let j = 8; j <= 15; j++) {//j是行
                if (!isNaN(this.state.Data[j]['shuju'][i]) && (this.state.Data[j]['shuju'][i] != null)) {
                    inputCount8[i]++;
                    if (this.state.Data[j]['shuju'][i] <= standard[i]) {
                        passCount8[i]++;
                    }
                }
                if (inputCount8[i] === 0) {
                    str = null;
                    temp1 = null;
                }
                else {
                    str = passCount8[i] + '\/' + inputCount8[i];
                    if (isNaN(temp1 = passCount8[i] / inputCount8[i])) {
                        temp1 = null;
                    }
                    else {
                        temp1 = Number(temp1 * 100).toFixed(1) + '%';
                    }
                }
                ratio8[i] = str;
                passRate8[i] = temp1;
            }
            for (let j = 16; j <= 23; j++) {//j是行
                if (!isNaN(this.state.Data[j]['shuju'][i]) && (this.state.Data[j]['shuju'][i] != null)) {
                    inputCount16[i]++;
                    if (this.state.Data[j]['shuju'][i] <= standard[i]) {
                        passCount16[i]++;
                    }
                }
                if (inputCount16[i] === 0) {
                    str = null;
                    temp1 = null;
                }
                else {
                    str = passCount16[i] + '\/' + inputCount16[i];
                    if (isNaN(temp1 = passCount16[i] / inputCount16[i])) {
                        temp1 = null;
                    }
                    else {
                        temp1 = Number(temp1 * 100).toFixed(1) + '%';
                    }
                }
                ratio16[i] = str;
                passRate16[i] = temp1;
            }
            let ratio = ratio0.concat(ratio8);
            ratio = ratio.concat(ratio16);
            let passRate = passRate0.concat(passRate8);
            passRate = passRate.concat(passRate16);
            this.setState({
                ratio: ratio,
                passRate: passRate,
            })
        }
        //计算均值的部分
        let average0 = [], average8 = [], average16 = [];//各班次的合格率
        for (let i = 0; i < 9; i++) {
            temp1 = 0;
            temp2 = 0;
            temp3 = 0;
            if (inputCount0[i] === 0) {
                temp1 = null;
            }
            else {
                for (let j = 0; j < 8; j++) {
                    if (!isNaN(this.state.Data[j]['shuju'][i])) {
                        temp1 += this.state.Data[j]['shuju'][i];
                    }
                }
                if (isNaN(temp1 = temp1 / inputCount0[i])) {
                    temp1 = 0;
                }
                temp1 = temp1.toFixed(3);
            }
            average0[i] = temp1;
            if (inputCount8[i] === 0) {
                temp2 = null;
            }
            else {
                for (let j = 8; j < 16; j++) {
                    if (!isNaN(this.state.Data[j]['shuju'][i])) {
                        temp2 += this.state.Data[j]['shuju'][i];
                    }
                }
                if (isNaN(temp2 = temp2 / inputCount8[i])) {
                    temp2 = 0;
                }
                temp2 = temp2.toFixed(3);
            }
            average8[i] = temp2;
            if (inputCount16[i] === 0) {
                temp3 = null;
            }
            else {
                for (let j = 16; j < 24; j++) {
                    if (!isNaN(this.state.Data[j]['shuju'][i])) {
                        temp3 += this.state.Data[j]['shuju'][i];
                    }
                }
                if (isNaN(temp3 = temp3 / inputCount16[i])) {
                    temp3 = 0;
                }
                temp3 = temp3.toFixed(3);
            }
            average16[i] = temp3;
        }
        let average = average0.concat(average8);
        average = average.concat(average16);
        this.setState({
            average: average
        });
        //是否正常的更新部分
        let newNormal = [];
        for (let i = 0; i < 24; i++) {
            if (!isNaN(this.state.Data[i]['shuju'][0]) && (this.state.Data[i]['shuju'][0] != null)) {
                if (this.state.Data[i]['shuju'][0] <= standard[0]) {
                    newNormal[i] = '正常';
                }
                else {
                    newNormal[i] = '异常';
                }
            }
            else {
                newNormal[i] = '';
            }
        }
        this.setState({
            isNormal: newNormal
        })
    }

    /***
     * 进行底部的合格率、平均数的计算更新以及是否正常的判断
     **/
    updataData(standard) {
        let temp1 = 0;
        let inputCount = [];
        let passCount = [];
        let str = '';
        let xiaoshi = this.props.timeChose * 8;//都加上选择的时间
        for (let i = 0; i < 9; i++) {//i是列
            inputCount[i] = 0;//输入的总数
            passCount[i] = 0;//合格数
            for (let j = xiaoshi; j < xiaoshi + 8; j++) {//j是行
                if (!isNaN(this.state.Data[j]['shuju'][i]) && (this.state.Data[j]['shuju'][i] != null)) {
                    inputCount[i]++;
                    if (this.state.Data[j]['shuju'][i] <= standard[i]) {
                        passCount[i]++;
                    }
                }
                if (inputCount[i] === 0) {
                    str = null;
                    temp1 = null;
                }
                else {
                    str = passCount[i] + '\/' + inputCount[i];
                    if (isNaN(temp1 = passCount[i] / inputCount[i])) {
                        temp1 = null;
                    }
                    else {
                        temp1 = Number(temp1 * 100).toFixed(1) + '%';
                    }
                }
                const ratio = this.state.ratio;
                const passRate = this.state.passRate;
                ratio[i + this.props.timeChose * 9] = str;
                passRate[i + this.props.timeChose * 9] = temp1;
                this.setState({
                    ratio: ratio,//比值
                    passRate: passRate//合格率
                })
            }
        }
        //计算均值的部分
        for (let i = 0; i < 9; i++) {
            temp1 = 0;
            if (inputCount[i] === 0) {
                temp1 = null;
            }
            else {
                for (let j = xiaoshi; j < xiaoshi + 8; j++) {
                    if (!isNaN(this.state.Data[j]['shuju'][i])) {
                        temp1 += this.state.Data[j]['shuju'][i];
                    }
                }
                if (isNaN(temp1 = temp1 / inputCount[i])) {
                    temp1 = 0;
                }
                temp1 = temp1.toFixed(3);
            }
            let average = this.state.average;
            average[i + this.props.timeChose * 9] = temp1;
            this.setState({
                average: average
            })
        }
        //是否正常的更新部分
        for (let i = xiaoshi; i < xiaoshi + 8; i++) {
            const newNormal = this.state.isNormal;
            if (!isNaN(this.state.Data[i]['shuju'][0]) && (this.state.Data[i]['shuju'][0] != null)) {
                if (this.state.Data[i]['shuju'][0] <= standard[0]) {
                    newNormal[i] = '正常';
                }
                else {
                    newNormal[i] = '异常';
                }
            }
            else {
                newNormal[i] = '';
            }
            this.setState({
                isNormal: newNormal
            })
        }
    }


    render() {
        /**表头的设计**start**/
        const columns = [
            {
                title: '班次',
                dataIndex: 'time',
                width: '10%',
                render: (value, row, index) => {
                    const obj = {
                        children: value,
                        props: {}
                    };
                    if (index === 0) {
                        obj.props.rowSpan = 8;
                    }
                    if (index === 1) {
                        obj.props.colSpan = 0;
                    }
                    if (index === 2) {
                        obj.props.colSpan = 0;
                    }
                    if (index === 3) {
                        obj.props.colSpan = 0;
                    }
                    if (index === 4) {
                        obj.props.colSpan = 0;
                    }
                    if (index === 5) {
                        obj.props.colSpan = 0;
                    }
                    if (index === 6) {
                        obj.props.colSpan = 0;
                    }
                    if (index === 7) {
                        obj.props.colSpan = 0;
                    }
                    return obj;
                },
            },
            {
                title: '窑转速',
                key: 'YZS',
                width: '15%',
                children: [{
                    title: 'rpm',
                    dataIndex: 'YZS',
                }],
            },
            {
                title: '窑电流',
                key: 'YDL',
                width: '15%',
                children: [
                    {
                        title: 'A',
                        dataIndex: 'YDL'
                    },
                ],
            },
            {
                title: '生料喂料量',
                key: 'SLWL',
                width: '15%',
                children:
                    [{
                        title: 't/h',
                        dataIndex: 'SLWL'
                    }]
            },
            {
                title: '窑头喂煤量',
                key: 'YTWM',
                width: '15%',
                children: [
                    {
                        title: 't/h',
                        dataIndex: 'YTWM'
                    }
                ],
            },
            {
                title: '窑尾喂煤量',
                key: 'YWWM',
                width: '15%',
                children: [
                    {
                        title: 't/h',
                        dataIndex: 'YWWM'
                    }
                ],
            },
            {
                title: '人员',
                dataIndex: 'person',
                width: '7.5%',
            },
        ];

        /**表头的设计**end**/


        /**中间八行的数据输入**start**/
        const data = [];
        const Data = this.state.Data;
        for (let i = 0; i < 8; i++) {
            const xiaoshi = i + this.props.timeChose * 8;
            const value = Data[xiaoshi]['shuju'];
            data.push(
                {
                    time: this.state.BanCi,
                    YZS: <p style={{height: 20}}>{isNaN(value[0]) ? null : value[0]}</p>,
                    YDL: isNaN(value[1]) ? null : value[1],
                    SLWL: isNaN(value[2]) ? null : value[2],
                    YTWM: isNaN(value[3]) ? null : value[3],
                    YWWM: isNaN(value[4]) ? null : value[4],
                    person: Data[xiaoshi]['name'],
                })
        }

        /**中间八行的数据输入**end**/

        return (
            <div className="ZKSX2_upper">
                {/*表格填写*/}
                <Table style={this.props.style}
                       className="ZKSX2_upper_table" columns={columns} bordered
                       dataSource={data} pagination={false}/>

            </div>
        );
    }

}

class BottomPartOfTheForm extends Component {
    constructor(props) {
        super(props);
        this.state = {
            Data: [[], [], [], [],],
            BanCi: [],
            weightAverage: ''//平均立升重
        }
    }

    /**初始化**/
    componentWillMount() {
        this.setState({
            Data: this.props.bottomData,
            timeChose: this.props.timeChose,
        });
    }

    /**更新props**/
    componentWillReceiveProps(nextProps) {
        this.setState({
            Data: nextProps.bottomData,
            timeChose: nextProps.timeChose,
        });
    }


    render() {
        //表头
        const columns = [
            {
                title: '1',
                dataIndex: '1',
                width: '10%',
                render(value, row, index) {
                    const obj = {
                        children: value,
                        props: {}
                    };
                    if (index === 0) {//备注
                        obj.props.rowSpan = 2;
                    }
                    if (index === 1) {//接班
                        obj.props.rowSpan = 0;
                    }
                    if (index === 2) {//接班
                        obj.props.rowSpan = 1;
                        obj.props.colSpan = 2;
                    }
                    if (index === 3) {//空白
                        obj.props.rowSpan = 6;
                        obj.props.colSpan = 10;
                    }
                    if (index === 4) {
                        obj.props.rowSpan = 0;
                    }
                    if (index === 5) {
                        obj.props.rowSpan = 0;
                    }
                    if (index === 6) {
                        obj.props.rowSpan = 0;
                    }
                    if (index === 7) {
                        obj.props.rowSpan = 0;
                    }
                    if (index === 8) {
                        obj.props.rowSpan = 0;
                    }
                    if (index === 9) {//班长
                        obj.props.rowSpan = 1;
                        obj.props.colSpan = 1;
                    }
                    return obj;
                },
            },
            {
                title: '2',
                dataIndex: '2',
                width: '10%',
                render(value, row, index) {
                    const obj = {
                        children: value,
                        props: {}
                    };
                    if (index === 0) {//备注
                        obj.props.colSpan = 9;
                    }
                    if (index === 1) {//接班
                        obj.props.rowSpan = 1;
                        obj.props.colSpan = 3;
                    }
                    if (index === 2) {//接班
                        obj.props.rowSpan = 1;
                        obj.props.colSpan = 0;
                    }
                    if (index === 3) {//空白
                        obj.props.rowSpan = 6;
                        obj.props.colSpan = 0;
                    }
                    if (index === 4) {
                        obj.props.rowSpan = 0;
                    }
                    if (index === 5) {
                        obj.props.rowSpan = 0;
                    }
                    if (index === 6) {
                        obj.props.rowSpan = 0;
                    }
                    if (index === 7) {
                        obj.props.rowSpan = 0;
                    }
                    if (index === 8) {
                        obj.props.rowSpan = 0;
                    }
                    if (index === 9) {//班长
                        obj.props.rowSpan = 1;
                        obj.props.colSpan = 1;
                    }
                    return obj;
                },
            },
            {
                title: '3',
                dataIndex: '3',
                width: '10%',
                render(value, row, index) {
                    const obj = {
                        children: value,
                        props: {}
                    };
                    if (index === 0) {//备注
                        obj.props.colSpan = 0;
                    }
                    if (index === 1) {//接班
                        obj.props.rowSpan = 1;
                        obj.props.colSpan = 0;
                    }
                    if (index === 2) {//接班
                        obj.props.rowSpan = 1;
                        obj.props.colSpan = 2;
                    }
                    if (index === 3) {//空白
                        obj.props.rowSpan = 6;
                        obj.props.colSpan = 0;
                    }
                    if (index === 4) {
                        obj.props.rowSpan = 0;
                    }
                    if (index === 5) {
                        obj.props.rowSpan = 0;
                    }
                    if (index === 6) {
                        obj.props.rowSpan = 0;
                    }
                    if (index === 7) {
                        obj.props.rowSpan = 0;
                    }
                    if (index === 8) {
                        obj.props.rowSpan = 0;
                    }
                    if (index === 9) {//班长
                        obj.props.rowSpan = 1;
                        obj.props.colSpan = 1;
                    }
                    return obj;
                },
            },
            {
                title: '4',
                dataIndex: '4',
                width: '10%',
                render(value, row, index) {
                    const obj = {
                        children: value,
                        props: {}
                    };
                    if (index === 0) {//备注
                        obj.props.colSpan = 0;
                    }
                    if (index === 1) {//接班
                        obj.props.rowSpan = 1;
                        obj.props.colSpan = 0;
                    }
                    if (index === 2) {//接班
                        obj.props.rowSpan = 1;
                        obj.props.colSpan = 0;
                    }
                    if (index === 3) {//空白
                        obj.props.rowSpan = 6;
                        obj.props.colSpan = 0;
                    }
                    if (index === 4) {
                        obj.props.rowSpan = 0;
                    }
                    if (index === 5) {
                        obj.props.rowSpan = 0;
                    }
                    if (index === 6) {
                        obj.props.rowSpan = 0;
                    }
                    if (index === 7) {
                        obj.props.rowSpan = 0;
                    }
                    if (index === 8) {
                        obj.props.rowSpan = 0;
                    }
                    if (index === 9) {//班长
                        obj.props.rowSpan = 1;
                        obj.props.colSpan = 1;
                    }
                    return obj;
                },
            },
            {
                title: '5',
                dataIndex: '5',
                width: '10%',
                render(value, row, index) {
                    const obj = {
                        children: value,
                        props: {}
                    };
                    if (index === 0) {//备注
                        obj.props.colSpan = 0;
                    }
                    if (index === 1) {//接班
                        obj.props.rowSpan = 1;
                        obj.props.colSpan = 3;
                    }
                    if (index === 2) {//接班
                        obj.props.rowSpan = 1;
                        obj.props.colSpan = 3;
                    }
                    if (index === 3) {//空白
                        obj.props.rowSpan = 6;
                        obj.props.colSpan = 0;
                    }
                    if (index === 4) {
                        obj.props.rowSpan = 0;
                    }
                    if (index === 5) {
                        obj.props.rowSpan = 0;
                    }
                    if (index === 6) {
                        obj.props.rowSpan = 0;
                    }
                    if (index === 7) {
                        obj.props.rowSpan = 0;
                    }
                    if (index === 8) {
                        obj.props.rowSpan = 0;
                    }
                    if (index === 9) {//班长
                        obj.props.rowSpan = 1;
                        obj.props.colSpan = 1;
                    }
                    return obj;
                },
            },
            {
                title: '6',
                dataIndex: '6',
                width: '10%',
                render(value, row, index) {
                    const obj = {
                        children: value,
                        props: {}
                    };
                    if (index === 0) {//备注
                        obj.props.colSpan = 0;
                    }
                    if (index === 1) {//接班
                        obj.props.rowSpan = 1;
                        obj.props.colSpan = 0;
                    }
                    if (index === 2) {//接班
                        obj.props.rowSpan = 1;
                        obj.props.colSpan = 0;
                    }
                    if (index === 3) {//空白
                        obj.props.rowSpan = 6;
                        obj.props.colSpan = 0;
                    }
                    if (index === 4) {
                        obj.props.rowSpan = 0;
                    }
                    if (index === 5) {
                        obj.props.rowSpan = 0;
                    }
                    if (index === 6) {
                        obj.props.rowSpan = 0;
                    }
                    if (index === 7) {
                        obj.props.rowSpan = 0;
                    }
                    if (index === 8) {
                        obj.props.rowSpan = 0;
                    }
                    if (index === 9) {//班长
                        obj.props.rowSpan = 1;
                        obj.props.colSpan = 1;
                    }
                    return obj;
                },
            },
            {
                title: '7',
                dataIndex: '7',
                width: '10%',
                render(value, row, index) {
                    const obj = {
                        children: value,
                        props: {}
                    };
                    if (index === 0) {//备注
                        obj.props.colSpan = 0;
                    }
                    if (index === 1) {//接班
                        obj.props.rowSpan = 1;
                        obj.props.colSpan = 0;
                    }
                    if (index === 2) {//接班
                        obj.props.rowSpan = 1;
                        obj.props.colSpan = 0;
                    }
                    if (index === 3) {//空白
                        obj.props.rowSpan = 6;
                        obj.props.colSpan = 0;
                    }
                    if (index === 4) {
                        obj.props.rowSpan = 0;
                    }
                    if (index === 5) {
                        obj.props.rowSpan = 0;
                    }
                    if (index === 6) {
                        obj.props.rowSpan = 0;
                    }
                    if (index === 7) {
                        obj.props.rowSpan = 0;
                    }
                    if (index === 8) {
                        obj.props.rowSpan = 0;
                    }
                    if (index === 9) {//班长
                        obj.props.rowSpan = 1;
                        obj.props.colSpan = 1;
                    }
                    return obj;
                },
            },
            {
                title: '8',
                dataIndex: '8',
                width: '10%',
                render(value, row, index) {
                    const obj = {
                        children: value,
                        props: {}
                    };
                    if (index === 0) {//备注
                        obj.props.colSpan = 0;
                    }
                    if (index === 1) {//接班
                        obj.props.rowSpan = 1;
                        obj.props.colSpan = 1;
                    }
                    if (index === 2) {//接班
                        obj.props.rowSpan = 1;
                        obj.props.colSpan = 3;
                    }
                    if (index === 3) {//空白
                        obj.props.rowSpan = 6;
                        obj.props.colSpan = 0;
                    }
                    if (index === 4) {
                        obj.props.rowSpan = 0;
                    }
                    if (index === 5) {
                        obj.props.rowSpan = 0;
                    }
                    if (index === 6) {
                        obj.props.rowSpan = 0;
                    }
                    if (index === 7) {
                        obj.props.rowSpan = 0;
                    }
                    if (index === 8) {
                        obj.props.rowSpan = 0;
                    }
                    if (index === 9) {//班长
                        obj.props.rowSpan = 1;
                        obj.props.colSpan = 1;
                    }
                    return obj;
                },
            },
            {
                title: '9',
                dataIndex: '9',
                width: '10%',
                render(value, row, index) {
                    const obj = {
                        children: value,
                        props: {}
                    };
                    if (index === 0) {//备注
                        obj.props.colSpan = 0;
                    }
                    if (index === 1) {//接班
                        obj.props.rowSpan = 1;
                        obj.props.colSpan = 2;
                    }
                    if (index === 2) {//接班
                        obj.props.rowSpan = 1;
                        obj.props.colSpan = 0;
                    }
                    if (index === 3) {//空白
                        obj.props.rowSpan = 6;
                        obj.props.colSpan = 0;
                    }
                    if (index === 4) {
                        obj.props.rowSpan = 0;
                    }
                    if (index === 5) {
                        obj.props.rowSpan = 0;
                    }
                    if (index === 6) {
                        obj.props.rowSpan = 0;
                    }
                    if (index === 7) {
                        obj.props.rowSpan = 0;
                    }
                    if (index === 8) {
                        obj.props.rowSpan = 0;
                    }
                    if (index === 9) {//班长
                        obj.props.rowSpan = 1;
                        obj.props.colSpan = 1;
                    }
                    return obj;
                },
            },
            {
                title: '10',
                dataIndex: '10',
                width: '10%',
                render(value, row, index) {
                    const obj = {
                        children: value,
                        props: {}
                    };
                    if (index === 0) {//备注
                        obj.props.colSpan = 0;
                    }
                    if (index === 1) {//接班
                        obj.props.rowSpan = 1;
                        obj.props.colSpan = 0;
                    }
                    if (index === 2) {//接班
                        obj.props.rowSpan = 1;
                        obj.props.colSpan = 0;
                    }
                    if (index === 3) {//空白
                        obj.props.rowSpan = 6;
                        obj.props.colSpan = 0;
                    }
                    if (index === 4) {
                        obj.props.rowSpan = 0;
                    }
                    if (index === 5) {
                        obj.props.rowSpan = 0;
                    }
                    if (index === 6) {
                        obj.props.rowSpan = 0;
                    }
                    if (index === 7) {
                        obj.props.rowSpan = 0;
                    }
                    if (index === 8) {
                        obj.props.rowSpan = 0;
                    }
                    if (index === 9) {//班长
                        obj.props.rowSpan = 1;
                        obj.props.colSpan = 1;
                    }
                    return obj;
                },
            },
        ];


        //左边班次的输入
        const Data = this.state.Data[this.state.timeChose];
        const data = [
                {
                    1: '备注',
                    2: <TextArea value={Data[0][0]}
                                 style={{
                                     resize: "none"
                                 }}/>,
                },
                {
                    2: <span>均化XX:&emsp; {Data[1][0]}&emsp;风机</span>,
                    5: <span>移重XX:&emsp;{Data[1][1]}&emsp;风机</span>,
                    8: 'XXXXXX:0点班  8点班  16点班',
                    9: this.state.timeChose * 8 + '点班',
                },
                {
                    1: '接班:中心风  内风  外风',//长度2
                    3: Data[3][0],//长度2
                    5: <span>燃烧器:&emsp; {Data[1][2]}&emsp;位</span>,//长度3
                    8: <span>孰料仓位:&emsp; {Data[1][3]}&emsp;米</span>,//长度3
                },
                {
                    1: <TextArea value={Data[0][1]}
                                 style={{
                                     resize: "none"
                                 }}/>,
                }, {}, {}, {}, {}, {},
                {
                    1: '班长：',//长度4
                    2: Data[3][2],
                    3: '操作员：',//长度4
                    4: Data[3][3],
                    5: '投料时间',//长度3
                    6: Data[2],//长度4
                    7: '投料量',
                    8: <span>{Data[1][4]}/ {Data[1][5]}</span>,//长度3
                    9: '孰料产量',//长度4
                    10: <span> {Data[1][6]} /{Data[1][7]}</span>,
                },
            ]
        ;

        return (
            <div className="ZKSX2_bottom">
                <Table style={this.props.style}
                       className='ZKSX2_bottom_table' dataSource={data} bordered
                       columns={columns} showHeader={false} pagination={false}/>

            </div>
        );
    }

}

export default class CKzksscxtjlx2 extends Component {
    render() {
        return (
            <Fragment>
                <div style={this.props.style}>
                    <h1 align="center">{this.props.title}</h1>
                    <span style={{float: "center", font: '20px', paddingLeft: 20}}>日期：{this.props.riqi}</span>
                    <span
                        style={{float: "center", font: '20px', paddingLeft: 20}}>班次：{this.props.timeChose * 8}点班</span>
                    {/*表单上半部分*/}
                    <UpperPartOfTheForm style={this.props.style} standard={this.props.zhibiao}
                                        timeChose={this.props.timeChose}
                                        person={this.props.person} upperData={this.props.upperData}
                    />
                    {/*表单下半部分*/}
                    <BottomPartOfTheForm style={this.props.style} standard={this.props.zhibiao}
                                         timeChose={this.props.timeChose}
                                         person={this.props.person} bottomData={this.props.bottomData}/>
                </div>
            </Fragment>


        );

    }
}
